
module ThreadSessionClientModule
	def create soc
		soc.write "301 SESSION CREATE\n"
		response = soc.gets
		
		if m = response.matches(/^302 SESSION CREATED (.+)$/) then
			return m[1]
		end
		
		return nil
	end
	
	def restore soc, id
		soc.write "302 SESSION RESTORE #{id}\n"
		response = soc.gets
		
		if m = response.matches(/^302 SESSION RESTORED (.+)$/) then
			return m[1]
		end
		
		return nil
	end
end